import { defineStore } from 'pinia';
import { ref } from 'vue';
import type { CommandSender } from '../commandHelper';

type SendCreateTaskCmd = CommandSender<any, any> | null;

// 1. 先按原来的方式定义Store（完全不变）
export const useCreateTaskStore = defineStore('createTaskInjection', () => {
  const sendCreateTaskCmd = ref<SendCreateTaskCmd>(null);

  const setInjections = (injections: { sendCreateTaskCmd?: SendCreateTaskCmd }) => {
    if (injections.sendCreateTaskCmd) {
      sendCreateTaskCmd.value = injections.sendCreateTaskCmd;
    }
  };

  return { sendCreateTaskCmd, setInjections };

});